﻿/*
 * Copyright 2008 Pimm Hogeling, Karim Sempel and Demian Sempel
 * 
 * This file is part of 8bitplays.
 * 
 * 8bitplays is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 * 
 * 8bitplays is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with 8bitplays. If not, see <http://www.gnu.org/licenses/>.
 */
package nl.sandmen.team.data {
	import flash.net.URLRequest;
	/**
	* @author Team Sandmen
	*/
	public class Track {
		public var name:String;
		public var url:String;
		public function Track(name:String, url:String):void {
			this.name = name;
			this.url = url;
		}
		public function get urlRequest():URLRequest {
			// Most albums on 8bitpeoples link to a scene.org FTP mirror. Since Flash/AIR doesn't like FTP protocols we try this
			//  HTTP mirror instead.
			return new URLRequest("http://http.de.scene.org/pub/music/groups/8bitpeoples/" + url.split("/").pop());
		}
		public function get originalUrlRequest():URLRequest {
			return new URLRequest(url);
		}
	}
}